<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateWithdrawTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('withdraw', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('type',20)->default('fil')->comment('fil,red');
            $table->string('token',50)->defalut('FIL')->comment('TOKEN类型FIL RED');
            $table->decimal('amount',65,12)->default(0)->comment('提现数量');
            $table->integer('mid')->default(0)->comment('矿机id');
            $table->timestamp('add_time')->default(DB::raw('CURRENT_TIMESTAMP'))->comment('添加时间');
            $table->timestamp('check_time')->nullable()->comment('审核时间');
            $table->tinyInteger('state')->default(0)->comment('审核状态 未审核0  审核成功1');
            $table->string('user_name','20')->nullable()->comment('用户名称');
            $table->text('note')->nullable()->comment('驳回理由');
            $table->string('withdraw_by',50)->default('address')->comment('提现通过  address地址，bank银行');
            $table->engine = 'InnoDB';
            $table->charset = 'utf8';
            $table->collation = 'utf8_unicode_ci';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('withdraw');
    }
}
